<template>
	<view>
		<view class="wap">
			<view class="lsit">
				<view class="lsit-title overflow-hidden-tuo">{{info.title}}</view>
				<view class="lsit-time">{{info.createtime}}</view>
				<view class="lsit-content">
					<view class="lsit-banner">
						<view class="lsit-content-text overflow-hidden-four">
							<view>{{info.content}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getNoticeDetails,
	} from '../../apirequest/api.js';
	export default {
		data() {
			return {
				id:0,
				info:null
			}
		},
		onLoad(o) {
			let id = o.id || 0;
			if (!parseInt(id)) {
				uni.showToast({
					title:'参数错误',
					icon:"error"
				})
				setTimeout(function(){
					uni.navigateBack({
						delta:0
					});
				},1000)
				
				return ;
			}
			this.id = id;
			this.loadData();
		},
		methods: {
			//获取数据
			loadData: function() {
				getNoticeDetails({id:this.id}).then((res) => {
					if (res.code == 1) {
						this.info = res.data;
					} else {
						uni.showToast({
							title:res.msg,
							icon:"error"
						});
						setTimeout(function(){
							uni.navigateBack({
								delta:0
							});
						},1000)
					}
				}).catch(err => {
					console.log(err)
				})
			
			},	
		}
	}
</script>

<style>
	.wap .lsit {
		margin: 10px 15px
	}

	.wap .lsit .lsit-title {
		color: #333;
		font-size: 20px;
		font-weight: 700
	}

	.wap .lsit .lsit-time {
		padding: 10px 0px;
		color: #bec1c7;
		font-size: 15px
	}

	.wap .lsit-content .lsit-banner image {
		width: 100%;
		height: 140px
	}

	.wap .lsit-content .lsit-banner .lsit-content-text {
		color: #999;
		font-size: 14px
	}
</style>
